/**
 * @author 徐楠
 * @date 2020/12/24 8:29
 * @version 1.0
 */

package edu.nuist.javaProjct.view;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class MyTestForm {
    private JPanel myTestPanel;
    private JButton labelBtn;
    private JLabel appLabel;
    private JButton button1;
    private JLabel lable1;

    public MyTestForm() {
        labelBtn.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                appLabel.setText("你好");
            }
        });
        button1.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                lable1.setText("fuck");
            }
        });
    }

    public static void main(String[] args) {
        JFrame frame = new JFrame("MyTestForm");
        frame.setContentPane(new MyTestForm().myTestPanel);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
        frame.setSize(800,800);
    }
}
